import {login} from "../../apis/gyt"

Page({
  data: { account: '', password: '',msg:"" },
  onLoad(){
    var etime=new Date("2025-04-12 16:00")
    if(etime-new Date()>0){
        this.setData({account: '002048hhxacs', password: 'Lzmdg!@#123'})
    }
  },
  inputAccount(e) { this.setData({ account: e.detail.value }) },
  inputPassword(e) { this.setData({ password: e.detail.value }) },
  async handleLogin() {
    if(!this.data.account||!this.data.password){
      return this.setData({msg:"输入用户名和密码"})
    }
      var res= await login(this.data.account,this.data.password);
      if(res.code==200){
        wx.reLaunch({ url: '/pages/index/index' });
      }
      else{
        return this.setData({msg:res.msg});
      }
    
    
    
  }
})